package com.cutthroatcreations.woodenrailway;

import java.util.ArrayList;
import android.graphics.Bitmap;

public class Train {

	// privates
	private int id;
	private String name;
	private String item_number;
	private String synopsis;
	private Bitmap bitmap;
	private boolean owned;
	private int numYears;
	private int user_id;
	

	// publics
	public ArrayList<Year> years;
	public ArrayList<Image> images;
	public ArrayList<Integer> allYears;

	// Empty constructor
	public Train() {

	}

	// getting ID
	public int getID() {
		return this.id;
	}

	// setting id
	public void setID(int id) {
		this.id = id;
	}

	// getting name
	public String getName() {
		return this.name;
	}

	// setting name
	public void setName(String name) {
		this.name = name;
	}

	// getting itemNumber
	public String getItemNumber() {
		return this.item_number;
	}

	// setting itemNumber
	public void setItemNumber(String itemNumber) {
		this.item_number = itemNumber;
	}

	// getting synopsis
	public String getSynopsis() {
		return this.synopsis;
	}

	// setting synopsis
	public void setSynopsis(String synopsis) {
		this.synopsis = synopsis;
	}

	public String getImageName() {
		String imageName = images.get(0).image_name;
		return imageName;
	}

	public String getImageNameWithIndex(int index) {
		String imageName = images.get(index).image_name;
		return imageName;
	}

	// getting bitmap
	public Bitmap getBitmap() {
		return this.bitmap;
	}

	// setting bitmap
	public void setBitmap(Bitmap bitmap) {
		this.bitmap = bitmap;
	}
	
	//getting numYears
	public int getNumYears() {
		return numYears;
	}

	//setting numYears
	public void setNumYears(int numYears) {
		this.numYears = numYears;
	}

	public int getUser_id() {
		return user_id;
	}

	public void setUser_id(int user_id) {
		this.user_id = user_id;
	}

	// is item part of collection
	public boolean owned(){
		return owned;
	}
	
	//set whether item is owned or not
	public void setOwnership(boolean o) {
		this.owned = o;
	}
	
	public void addAllYears(ArrayList<Integer> y){
		this.allYears = y;
	}
	
	// these classes necessary for GSON object creation
	public class Image {

		public String image_name;

	}
	
	public class Year {

		public String start_year;
		public String end_year;
		
		
	}

	@Override
	public String toString() {
		
		return this.getName() + " - " + this.getItemNumber();
	}
	
	
	
}
